﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SSDL_IndentityModify
{
    public partial class Form1 : Form
    {
        EntityModelUpdate emu;
        String[,] Xpaths = 
        { 
            {"EduStory","Id"},
            {"WorkStory","Id"},
            {
                "Household","Id"
            },
            {
                "Person","Sequence"
            },
            {
                "ExamRoom","Id"
            },
            {
                "ActivityLog","Id"
            }
        };
        public Form1()
        {
            InitializeComponent();
            emu = new EntityModelUpdate();
            emu.Xpaths = this.Xpaths;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            emu.FixIt();
            MessageBox.Show("Finished changed?" + emu.DocumentChanged + "   Changed count:" + emu.ChangedProperty);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            DialogResult res = openFileDialog1.ShowDialog();
            if (res == DialogResult.OK)
            {
                emu.Filename = openFileDialog1.FileName;
                emu.FixIt();
                MessageBox.Show("Finished changed?" + emu.DocumentChanged + "   Changed count:" + emu.ChangedProperty);
            }
        }
    }
}
